<?php

//$moduleName = Zend_Controller_Front::getInstance()->getRequest()->getModuleName();
$controllerName = Zend_Controller_Front::getInstance()->getRequest()->getControllerName();

echo $this->render('header.phtml');
echo $this->render('slidebar.phtml');
echo '<div id="content">';
echo $this->layout()->content;
if ($controllerName == 'pages') {
    if (!empty($this->is_comment)) {
        echo $this->render('slidebar/view-comments.phtml');
        echo $this->render('add-comment.phtml');
    }
    if (isset($this->alike)) // похожие страницы
        echo $this->render('alike-page.phtml');
}
echo "</div>";
echo $this->render('footer.phtml');
?>